Implement TextBox component with HTML5 input type support#286
Merged
csharpfritz merged 7 commits intodevfrom Jan 28, 2026
Merged
Implement TextBox component with HTML5 input type support#286csharpfritz merged 7 commits intodevfrom
csharpfritz merged 7 commits intodevfrom
Conversation
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement TextBox Blazor component
Implement TextBox component with HTML5 input type support
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the TextBox component emulating ASP.NET Web Forms
System.Web.UI.WebControls.TextBoxwith support for single-line, multi-line (textarea), password, and HTML5 input types.Component Implementation
<input>or<textarea>based onTextModepropertyStyle System Enhancement
Fixed missing width/height rendering in
HasStyleExtensions.ToStyle()- now properly outputswidthandheightCSS properties for all styled components:Usage Example
Test Coverage
28 unit tests covering input modes, attributes, styling, and visibility. All 274 solution tests pass.
Original prompt
This section details on the original issue you should resolve
<issue_title>Implement TextBox Component</issue_title>
<issue_description>## Overview
Implement the TextBox Blazor component that emulates the ASP.NET Web Forms
System.Web.UI.WebControls.TextBoxcontrol. This is an essential form control used for single-line text input, password input, and multi-line text areas.Microsoft Docs Reference: https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.textbox?view=netframework-4.8
Phase 1: Research & Reference Setup
Step 1: Add Web Forms Sample Page
Create sample page at
samples/BeforeWebForms/ControlSamples/TextBox/Default.aspx:Step 2: Capture HTML Output
Run the BeforeWebForms project and document the exact HTML output. Expected patterns:
Single-line TextBox:
Password TextBox:
MultiLine TextBox:
Phase 2: Blazor Implementation
Step 3: Create Component Files
Create
src/BlazorWebFormsComponents/TextBox.razor:Create
src/BlazorWebFormsComponents/TextBox.razor.cs:Step 4: Implement Core Features
Properties to implement:
Text- The text contentTextMode- SingleLine, MultiLine, Password, Email, Number, etc.MaxLength- Maximum characters allowedColumns- Width in characters (maps tosizeorcols)Rows- Height in rows (MultiLine only)ReadOnly- Prevents editingEnabled- From base class, maps todisabledCssClass- From base classBaseStyledComponentTextBoxMode enum (create in
Enums/TextBoxMode.cs):Phase 3: Testing & Documentation
Step 5: Add Unit Tests
Create tests in
src/BlazorWebFormsComponents.Test/TextBox/:Text.razor - Test text binding
TextMode.razor - Test different modes render correct input types
MultiLine.razor - Test textarea rendering
Attributes.razor - Test MaxLength, Rows, Columns, ReadOnly
Style.razor - Test CSS class and inline styles
Example test: